<!DOCTYPE html>
<html xmlns:fb="http://ogp.me/ns/fb#">
<head>
  <!-- Metadata -->
  <title>Falling Fruit</title>
  <meta name="description" content="An urban harvesting map that brings together community and city datasets from all over the internet. Find, add, and edit information on the wild edibles growing in your neighborhood." />
  <meta name="keywords" content="map, urban, harvest, edible, forage, glean, tree, inventory, plant, fruit, nut, berry, food, agriculture, community, Falling Fruit, Ethan Welty, Caleb Phillips" />

  <!-- Facebook OpenGraph Tags -->
  <meta property="og:title" content="Falling Fruit" />
  <meta property="og:url" content="http://fallingfruit.org/" />
  <meta property="og:description" content="An urban harvesting map that brings together community and city datasets from all over the internet. Find, add, and edit information on the wild edibles growing in your neighborhood." />
  <meta property="og:image" content="http://fallingfruit.org/fb-avatar.jpg" />

  <!-- Scripts & Styles -->
  <%= stylesheet_link_tag "application" %>
  <%= javascript_include_tag "application" %>
  <%= csrf_meta_tags %>
</head>
<body>

<% @is_index = (@current_controller == "locations") and (@current_action == "index") %>

<!-- Logo Bar -->
<div id="logobar">

 <!-- Logo -->
 <img src="/logo.png">
 
 <!-- AddThis Buttons -->
	<div id="share_controls" class="addthis_toolbox addthis_default_style" >
		<a class="addthis_button_facebook_like" fb:like:layout="button_count" addthis:url="http://www.facebook.com/FallingFruit"></a> 	
		<a class="addthis_counter addthis_pill_style" addthis:url="http://www.FallingFruit.org"></a>
	</div>
	<!-- URL tracking <script type="text/javascript">var addthis_config = {"data_track_addressbar":true};</script>-->
	<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-51390d312330c4fe"></script>
 
 <!-- Title -->
 <a id="falling_fruit" href="/">FallingFruit.org</a><span id="subtitle">Mapping the urban harvest</span>
 
 <!-- Alerts -->
 <% if notice or alert %>
 <div id="warnings">
  <a id="warnings_close" href="#" onclick="$('warnings').hide();">[x]</a>
  <% if notice %>
  <div class="notice"><%= notice %></div>
  <% end %>
  <% if alert %>
  <div class="alert"><%= alert %></div>
  <% end %>
 </div>
 <% end %>
</div>

<!-- Menu Bar -->
<div id="menubar">
 <div id="rightcontrols">
 <% if admin_signed_in? %>
  <span id="admin_email"><%= current_admin.email %></span> <%= link_to('Account', edit_admin_registration_path) %><%= link_to('Logout', destroy_admin_session_path, :method => :delete) %>
 <% else %>
  <!-- <%= link_to('Admin', admins_path) %> -->
 <% end %>
 </div>
<%= link_to('Map', root_path, :id => "maplink", :class => (request.fullpath.split('?')[0] == root_path or not request.fullpath.match('/locations/[0-9]+').nil?) ? "currentpage" : "notcurrentpage") %>
<%= link_to('About', '/about', :class => (request.fullpath == '/about') ? "currentpage" : "notcurrentpage") %>
<%= link_to('Data', '/data', :class => (request.fullpath == '/data') ? "currentpage" : "notcurrentpage") %>
<%= link_to('Add Source', new_location_path, :class => (request.fullpath == new_location_path) ? "currentpage" : "notcurrentpage") %>
<% if (request.fullpath.split('?')[0] == root_path) and !admin_signed_in? %>
 <span id="clickmap">(or right-click on map)</span>
<% end %>
<% if admin_signed_in? %>
 <%= link_to('Types', types_path, :class => (request.fullpath == types_path) ? "currentpage" : "notcurrentpage") %>
 <%= link_to('Import', import_locations_path, :class => (request.fullpath == import_locations_path) ? "currentpage" : "notcurrentpage") %>/<%= link_to('Imports', imports_path, :class => (request.fullpath == imports_path) ? "currentpage" : "notcurrentpage") %>
 <%= link_to('Admins', admins_path, :class => (request.fullpath == admins_path) ? "currentpage" : "notcurrentpage") %>
<% end %>
</div>

<!-- Content -->
<% unless @is_index %>
<div id="content">
 <%= yield %>
 
 <!-- Footer -->
 <div id="footer">
  <a href="http://creativecommons.org/licenses/by-nc/3.0/deed.en_GB">Copyleft</a> (c) <%= Time.now.year %> Falling Fruit  
 </div>
</div>
<% else %>
<%= yield %>
<% end %>

<!-- Per Page Javascripts -->
<%= yield :page_scripts %>

<!-- Form Partial Javascripts -->
<%= yield :form_scripts %>

<!-- Google Analytics -->
<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-39120529-1']);
  _gaq.push(['_setDomainName', 'fallingfruit.org']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>

</body>
</html>
